export default {
	namespaced: true, // namespaced属性用于解决不同模块的命名冲突问题
	state: {
		tabberList: [], // 默认底部导航栏
		tabberIndex: uni.getStorageSync('tabberIndex') || 0 // 默认选中图标
	},
	mutations: {
		// 给Tabber默认选中赋值
		changeTabberIndex(state, index) {
			uni.setStorageSync('tabberIndex', index)
			state.tabberIndex = index
		},
		// 给底部导航栏赋值
		changeTabberList(state, data) {
			state.tabberList = data
		}
	},
	actions: {
		// 监督端
		tabberSupervise: ({ commit }) => {
			let menuList = [{
					icon: 'https://fire-system.oss-cn-beijing.aliyuncs.com/web/new-fire-iot/home.png',
					iconSelect: 'https://fire-system.oss-cn-beijing.aliyuncs.com/web/new-fire-iot/home-select.png',
					text: '首页',
					code: 'home',
				},
				{ customIcon: false, },
				{
					icon: 'https://fire-system.oss-cn-beijing.aliyuncs.com/web/new-fire-iot/personel.png',
					iconSelect: 'https://fire-system.oss-cn-beijing.aliyuncs.com/web/new-fire-iot/personel-select.png',
					text: '我的',
					code: 'personal',
				}
			]
			commit('changeTabberList', menuList)
		},

		// 专家端
		tabberExpert: ({ commit }) => {
			let menuList = [{
					icon: 'home',
					text: '首页',
					code: 'home',
				},
				{
					icon: 'account',
					text: '我的',
					code: 'personal',
				}
			]
			commit('changeTabberList', menuList)
		}
	}
}
